package mainPack;

public class Battery {

	protected String Model;
	protected String Producer;
	protected int Type;
	protected int Price;
	protected int Weight;
	protected double Ah;
	protected double Wh;
	protected double DischargePower;
	protected int Voltage;
	protected int Cycles;

	public Battery(){

	}

	public Battery(String M,String P,int T,int PR,int W,double AH,double WH,double DP,int V,int C){
		Model=M;
		Producer=P;
		Type=T;
		Price=PR;
		Weight=W;
		Ah=AH;
		Wh=WH;
		DischargePower=DP;
		Voltage=V;
		Cycles=C;
	}



	@Override
	public String toString() {
		return "Battery [Model=" + Model + ", Producer=" + Producer + "]";
	}

	public String toCSV(){
		return Model+";"+Producer+";"+Type+";"+Price+";"+Weight+";"+Ah+";"+Wh+";"+DischargePower+";"+Voltage+";"+Cycles+";";
	}

	//Covering the trade-off between the energy consumption and life time
	public double calculateCost(int TotWh, int SystemVoltage){
		return(Math.ceil(TotWh/Wh)*Price*(SystemVoltage/Voltage))/Cycles;
	}

	//Covering the energy consumption
	public double calculateCostNoCycles(int TotWh, int SystemVoltage){
		return Math.ceil(TotWh/Wh)*Price*(SystemVoltage/Voltage);
	}

	//Covering the trade-off between the energy consumption,life time and power demand
	public double calculateCost(int TotWh, int SystemVoltage,int MaxW){
		return (Math.ceil(TotWh/Wh)*Price*(SystemVoltage/Voltage)*Math.ceil(MaxW/DischargePower))/Cycles;
	}

	//covering the trade-off between the energy consumption and power demand
	public double calculateCostNoCycles(int TotWh, int SystemVoltage,int MaxW){
		return Math.ceil(TotWh/Wh)*Price*(SystemVoltage/Voltage)*Math.ceil(MaxW/DischargePower);
	}

	//Covering the trade-off between power demand and life time
	public double calculateCostWatt(int MaxW, int SystemVoltage){
		return(Math.ceil(MaxW/DischargePower)*Price*(SystemVoltage/Voltage))/Cycles;
	}

	public String getModel() {
		return Model;
	}

	public void setModel(String model) {
		Model = model;
	}

	public String getProducer() {
		return Producer;
	}

	public void setProducer(String producer) {
		Producer = producer;
	}

	public int getType() {
		return Type;
	}

	public void setType(int type) {
		Type = type;
	}

	public int getPrice() {
		return Price;
	}

	public void setPrice(int price) {
		Price = price;
	}

	public int getWeight() {
		return Weight;
	}

	public void setWeight(int weight) {
		Weight = weight;
	}

	public double getAh() {
		return Ah;
	}

	public void setAh(float ah) {
		Ah = ah;
	}

	public double getWh() {
		return Wh;
	}

	public void setWh(float wh) {
		Wh = wh;
	}

	public double getDischargePower() {
		return DischargePower;
	}

	public void setDischargePower(float dischargePower) {
		DischargePower = dischargePower;
	}

	public int getVoltage() {
		return Voltage;
	}

	public void setVoltage(int voltage) {
		Voltage = voltage;
	}

	public int getCycles() {
		return Cycles;
	}

	public void setCycles(int cycles) {
		Cycles = cycles;
	}

}
